import http from './http'

//登录
export const login = (name, password) => http.post('/admin/login', {
  name,
  password
});
//获取管理员信息
export const getAdminInfo = () => http('/admin/getAdminInfo');
// 更新修改管理员信息
export const updateAdminInfo = (adminId, avatar, name, sex, phone, birthday) => http.post('/admin/updateAdminInfo', {
  adminId,
  avatar,
  name,
  sex,
  phone,
  birthday,
});
// 注册管理员
export const resignAdmin = (name, password, sex, phone, birthday, avatar) => http.post('/admin/resignAdmin', {
  name,
  password,
  sex,
  phone,
  birthday,
  avatar,
});
// 更新修改管理员密码
export const updateAdminPassword = (adminId, oldPassword, newPassword) => http.post('/admin/updateAdminPassword', {
  adminId,
  oldPassword,
  newPassword
});
//获取当前页用户
export const getCurrentPageUser = (currentPage, pageSize, input) => http('/admin/getCurrentPageUser', {
  params: {
    currentPage,
    pageSize,
    input
  }
});
//上传图片到服务器
export const upLoadImg = (formData) => http.post('/admin/upLoadImg', formData);
//更新用户信息
export const updateUserInfo = (userId, userName, avatar, password, sex, phone, sign, birthday) => http.post('/admin/updateUserInfo', {
  userId,
  userName,
  avatar,
  password,
  sex,
  phone,
  sign,
  birthday
});
//删除用户信息
export const deleteUserInfo = (userId) => http.post('/admin/deleteUserInfo', {
  userId
});
//添加用户信息
export const addUserInfo = (userName, avatar, phone, password, sex, sign, birthday) => http.post('/admin/addUserInfo', {
  userName,
  avatar,
  phone,
  password,
  sex,
  sign,
  birthday
});
//获取当前页电影
export const getCurrentPageMovie = (currentPage, pageSize, input) => http('/admin/getCurrentPageMovie', {
  params: {
    currentPage,
    pageSize,
    input
  }
});
//更新电影信息
export const updateMovieInfo = (movieId, movieName, poster, director, actor, long, type, language, publicDate, intro) => http.post('/admin/updateMovieInfo', {
  movieId,
  movieName,
  poster,
  director,
  actor,
  long,
  type,
  language,
  publicDate,
  intro
});
//添加电影信息
export const addMovieInfo = (movieName, poster, director, actor, long, type, language, publicDate, intro) => http.post('/admin/addMovieInfo', {
  movieName,
  poster,
  director,
  actor,
  long,
  type,
  language,
  publicDate,
  intro
});
//上传图片到服务器
export const upLoadMovieImg = (formData) => http.post('/admin/upLoadMovieImg', formData);
//删除电影信息
export const deleteMovieInfo = (movieId) => http.post('/admin/deleteMovieInfo', {
  movieId
});
//获取当前页影院
export const getCurrentPageCinema = (currentPage, pageSize, input) => http('/admin/getCurrentPageCinema', {
  params: {
    currentPage,
    pageSize,
    input
  }
});
//更新影院信息
export const updateCinemaInfo = (cinemaId, cinemaName, cinemaPhone, address) => http.post('/admin/updateCinemaInfo', {
  cinemaId,
  cinemaName,
  cinemaPhone,
  address
});
//删除影院信息
export const deleteCinemaInfo = (cinemaId) => http.post('/admin/deleteCinemaInfo', {
  cinemaId
});
//添加影院信息
export const addCinemaInfo = (cinemaName, cinemaPhone, address) => http.post('/admin/addCinemaInfo', {
  cinemaName,
  cinemaPhone,
  address
});
//获取当前页用户评论
export const getCurrentPageComment = (currentPage, pageSize, input) => http('/admin/getCurrentPageComment', {
  params: {
    currentPage,
    pageSize,
    input
  }
});
//通过当前评论
export const passCurrentComment = (commentId, movieId) => http.post('/admin/passCurrentComment', {
  commentId,
  movieId
});
//删除当前评论
export const deleteCurrentComment = (commentId, movieId) => http.post('/admin/deleteCurrentComment', {
  commentId,
  movieId
});
//获取当前页订单
export const getCurrentPageOrder = (currentPage, pageSize, input) => http('/admin/getCurrentPageOrder', {
  params: {
    currentPage,
    pageSize,
    input
  }
});
//删除订单
export const deleteOrder = (orderId, scheduleId, orderSeatInfo) => http.post('/admin/deleteOrder', {
  orderId,
  scheduleId,
  orderSeatInfo
});
//获取当前页影厅
export const getCurrentPageHall = (currentPage, pageSize, input) => http('/admin/getCurrentPageHall', {
  params: {
    currentPage,
    pageSize,
    input
  }
});
//删除影厅
export const deleteHall = (cinemaId, hallName) => http.post('/admin/deleteHall', {
  cinemaId,
  hallName
});
//更新影厅信息
export const updateHallInfo = (hallId, cinemaId, hallOldName, hallNewName) => http.post('/admin/updateHallInfo', {
  hallId,
  cinemaId,
  hallOldName,
  hallNewName
});
//获取所有影院
export const getAllCinema = () => http('/admin/getAllCinema');
//添加影厅信息
export const addHallInfo = (cinemaId, hallName) => http.post('/admin/addHallInfo', {
  cinemaId,
  hallName
});
//获取当前页排片
export const getCurrentPageMovieSchedule = (currentPage, pageSize, input) => http('/admin/getCurrentPageMovieSchedule', {
  params: {
    currentPage,
    pageSize,
    input
  }
});
//获取所有影院
export const getAllMovie = () => http('/admin/getAllMovie');
//获取所有影院
export const getHallByCinemaId = (cinemaId) => http('/admin/getHallByCinemaId', {
  params: {
    cinemaId
  }
});
//获取排片的某天的时间段安排
export const getHasScheduleDateTime = (cinemaId, hallName, showDate) => http('/admin/getHasScheduleDateTime', {
  params: {
    cinemaId,
    hallName,
    showDate
  }
});
//添加排片信息
export const addScheduleInfo = (movieId, cinemaId, hallName, showDate, showTime, price) => http.post('/admin/addScheduleInfo', {
  movieId,
  cinemaId,
  hallName,
  showDate,
  showTime,
  price
});
//删除电影排片
export const deleteMovieSchedule = (scheduleId) => http.post('/admin/deleteMovieSchedule', {
  scheduleId
});
//获取喜欢电影
export const getLikeMovie = () => http('/admin/getLikeMovie');
//获取评分电影
export const getScoreMovie = () => http('/admin/getScoreMovie');
//获取所有电影信息
export const getAllMovieXX = () => http('/admin/getAllMovieXX');
//获取排片详情
export const getScheduleById = (scheduleId) => http('/api/getScheduleById', {
  params: {
    scheduleId
  }
});
//更新排片座位信息
export const updateScheduleSeat = (scheduleId, seatInfo) => http.post('/api/updateScheduleSeat', {
  scheduleId,
  seatInfo
});
